﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Data;

namespace NJT.ValueConverter
{
    public class 表格宽度转换 : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var 宽度 = (double)value;
            var r = new GridLength(宽度);
            return r;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var 宽度 = (GridLength)value;
            return 宽度.Value;
        }
    }
}
